<template>
  <el-container class="h-screen min-w-[1200px]">
    <el-header class="flex justify-between items-center bg-[#393d49]">
      <div>
        <h3 class="text-white">客 服 工 作 台</h3>
      </div>
      <div class="flex">
        <el-space size="large">
          <el-text class="text-gray-300 cursor-pointer" @click="downvoteListRef.open()">
            倒赞
          </el-text>
          <el-text class="text-white">
            <el-icon><User /></el-icon> 用户名
          </el-text>
          <el-link type="primary" :underline="false">退出</el-link>
        </el-space>
      </div>
    </el-header>
    <el-container class="h-full">
      <el-aside width="160px" class="bg-[#445163]">
        <UserStatus />
        <el-menu
          class="border-0"
          :default-active="route.name"
          active-text-color="#ffd04b"
          background-color="#445163"
          text-color="#fff"
          router
        >
          <el-menu-item v-for="menu in menuList" :index="menu.route">
            <el-icon><component :is="menu.icon" /></el-icon>
            <span>{{ menu.title }}</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main class="p-0">
        <router-view :key="<string>route.name" />
      </el-main>
    </el-container>
  </el-container>
  <DownvoteList ref="downvoteListRef" />
</template>

<script setup lang="ts">
import UserStatus from '@/manager/components/UserStatus.vue'
import { useRoute } from 'vue-router'
import { menuList } from '@/manager/constants'
import { User } from '@element-plus/icons-vue'
import DownvoteList from '@/manager/components/DownvoteList.vue'
import { ref } from 'vue'

const route = useRoute()

const downvoteListRef = ref()
</script>

<style scoped lang="less"></style>
